// const Grid = require('./ui/grid');
import Grid from './ui/grid'
// const PopupNumbers = require('./ui/popupnumbers')
import PopupNumbers from './ui/popupnumbers'
/*
// 得到 0 -- 8 的一个数组
// 测试数据
const matrix = toolkit.makeMatrix();
console.log(matrix)
const a = Array.from({length: 9}, (v, i) => i);
// 测试随机数组的效果
console.log(toolkit.shuffle(a))
*/


const grid = new Grid($('#container'));
grid.build();
grid.layout();

const popupNumbers = new PopupNumbers($('#popupNumbers'));
grid.bindPopup(popupNumbers);

$('#check').on('click', e => {
    if (grid.check()) {
        alert('成功')
    }

});
$('#reset').on('click', e => {
    grid.reset();
});
$('#clear').on('click', e => {
    grid.clear();
});
$('#rebuild').on('click', e => {
    grid.rebuild();
})
